package tecpointbenchmark.model.modules;
import java.util.Date;

import tecpointbenchmark.model.dto.ResultDTO;

/**
 * IntermediateGraphic
 * 
 * @author Clemens
 */
public class IntermediateGraphics extends BenchmarkModule{
	 public IntermediateGraphics(ResultDTO r) {
	        super(r);
	        super.setModuleName("Graphics benchmarking module");
	        super.setShortDescription("Performs a benchmark test on the graphiccard");
	        super.setLongDescription("Performs a benchmark test on the graphiccard by starting a multithreded applets "
	                + " and measure how long time a sequence of graphical objects can be written");
	    }
	 public void runBenchmark() {
		//Test program
		 
		 // Fetch the result object
	        ResultDTO result = super.getResult();
	      
	     // Allow benchmarking
	        super.setContinueBenchmarking(true);
	        
	        result.setTime(new Date().getTime());
	        
	     // Set the result to ERROR(2)
	        result.setNumber(2);
	        GFX_1_1 graphic = new GFX_1_1();
	        long start = System.currentTimeMillis();
	        graphic.graficTest();
	        
	        long end = System.currentTimeMillis();
	        float time = (end - start) / 1000f;
	        
	        result.setMessage("The time for the applet to run took " + time);
	        result.setPoints((int)time*10000);
	 }
}
